<?php
namespace App\Model;
use App\Repository\Common\ConstTable;
use App\Repository\Sys\JsonRespose;
use App\Repository\Sys\Db;
//服务表
class ServiceTable{
    use Db;
    static private $table = 'service';
    //服务-详情
    static public function getServiceInfo($id){
        $res = ServiceTable::ORM()->where('id', $id)->first();
        if (!$res) {
            return JsonRespose::fail('数据不存在');
        }
        $data = [
            'id' => $res->id,
            'title' => $res->title,
            'img_url' => $res->img_url,
            'type_text' => ConstTable::SERVICE_TYPE[$res->type],
            'content' => $res->content,
            
        ];
        return JsonRespose::jsonArray(1,$data);
    }
}
